package com.hzhjhh.view.manageView.menus.accountMng;

import java.awt.Frame;

import javax.swing.JDialog;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.JTextField;

import com.hzhjhh.view.manageView.menus.accountMng.login.CancelBt;
import com.hzhjhh.view.manageView.menus.accountMng.login.LoginBt;
import com.hzhjhh.view.manageView.menus.accountMng.login.LoginName;
import com.hzhjhh.view.manageView.menus.accountMng.login.LoginTitle;
import com.hzhjhh.view.manageView.menus.accountMng.login.Password;

import lombok.Getter;
import lombok.Setter;

import javax.swing.JButton;
import javax.swing.JLabel;

import javax.swing.JPasswordField;

/**
 * 后端管理员登录
 * 
 * @author 12083
 *
 */
@Getter
@Setter
public class Adminstrator extends JDialog {
	JPanel panel1 = new JPanel();
	JTextField txfName = new JTextField();
	JButton btLogin = new JButton();
	JButton btCancel = new JButton();
	JLabel lbUserName = new JLabel();
	JLabel lbPassword = new JLabel();
	JLabel lbLoginTitle = new JLabel();
	JPasswordField pfPassword = new JPasswordField();

	public Adminstrator(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		try {
			setDefaultCloseOperation(DISPOSE_ON_CLOSE);
			jbInit();
			pack();
		} catch (Exception exception) {
			exception.printStackTrace();
		}
	}

	public Adminstrator() {
		this(new Frame(), "管理员登录", false);
		this.setSize(400, 300);
		this.setLocation(300, 200);
		this.setVisible(true);
		this.setTitle("此功能需要超级管理员权限");

	}

	private void jbInit() throws Exception {
		panel1.setLayout(null);
		this.getContentPane().setBackground(Color.pink);
		panel1.setBackground(Color.pink);
		txfName = LoginName.txfInit(this);
		pfPassword = Password.psInit();
		btLogin = LoginBt.btInit(this);

		btCancel = CancelBt.btInit(this);

		lbUserName = LoginName.btInit(this);
		lbPassword = Password.btInit();
		lbLoginTitle = LoginTitle.btInit(this);

		getContentPane().add(panel1);
		panel1.add(lbLoginTitle);
		panel1.add(lbUserName);
		panel1.add(txfName);
		panel1.add(btLogin);
		panel1.add(btCancel);
		panel1.add(lbPassword);
		panel1.add(pfPassword);
	}

}
